package com.ld.poetry.aigc.iflycode.gclu.codecontinue;

public class SecurityService {
    public static Security[] getAllSecurities() {
        return new Security[]{
                new Security(1,"证券A", "2018-01-01", 1, 1.0),
                new Security(2,"证券B", "2018-01-02", 2, 1.5),
                new Security(3,"证券C", "2018-01-03", 3, 2.0),
        };
    }

    public static Security getSecurityByID(int securityID) {
        for (Security security : getAllSecurities()) {
            if (security.getSecurityID() == securityID) {
                return security;
            }
        }
        return null;
    }

    public static Security[] getTop10Securities() {
        return getAllSecurities();
    }

    public static Security[] getTop10SecuritiesByTradingPrice() {
        return getAllSecurities();
    }

    public String addSecurity(Security security){
        return "OK";
    }

    public String deleteSecurity(int securityID){
        return "OK";
    }

    public String updateSecurity(Security security){
        return "OK";
    }

}
